import { getCartApi } from "../../api";

const actions = {
  getCart(context) {
    getCartApi(
      (response) => {
        if (response.data.status === 1) {
          context.commit("GETCART", response.data.data);
        }
      },
      (err) => {
        console.log(err);
      }
    );
  },
}

const mutations = {
  GETCART(state, value) {
    state.cartList = value;
  }
}

const getters = {

}

const state = {
  cartList: []
}

export default {
  namespaced: true,
  actions,
  mutations,
  getters,
  state,
}